import request from '../utils/request';

/**
 * 通过项目Id查询反馈分页信息
 * @param {*} params
 */
const getPage = params => request({
  url: `/v1/project/test/${params.id}/page`,
  method: 'get',
  params
});
/**
 * 通过项目Id批量设置
 * @param {*} data
 */
const BatchUpdateStatus = data => request({
  url: `/v1/project/test//batch/status`,
  method: 'put',
  data
});

/**
 * 新增反馈
 * @param {*} data
 */
const create = data => request({
    url: `/v1/project/test`,
    method: 'post',
    data: data
});

/**
 * 指派反馈
 * @param {*} data
 */
const accept = data => request({
    url: `/v1/project/test/${data.id}/accept`,
    method: 'put',
    data: data
});

/**
 * 修改反馈状态
 * @param {*} data
 */
const status = data => request({
  url: `/v1/project/test/${data.id}/status`,
  method: 'put',
  data: data
});
/**
 * 修改反馈状态客户确认、业务确认
 * @param {*} data
 */
const bussStatus = data => request({
  url: `/v1/project/test/${data.id}/buss/status`,
  method: 'put',
  data: data
});

/**
 * 获取评论
 * @param {*} params
 */
const getComment = params => request({
    url: `/v1/project/test/${params.id}/comment`,
    method: 'get',
    data: params
});

/**
 * 获取历史记录
 * @param {*} params
 */
const getHistory = params => request({
  url: `/v1/project/test/${params.id}/log`,
  method: 'get',
  data: params
});
/**
 * 编辑
 * @param {*} data
 */
const getEdit = data => request({
  url: `/v1/project/test/${data.id}`,
  method: 'put',
  data: data
});
/**
 * 通过id获取记录
 * @param {*} params
 */
const getDataById = params => request({
  url: `/v1/project/test/${params.id}`,
  method: 'get',
  data: params
});
/**
 * 导出
 * @param {*} params
 */
const getExport = params => request({
  url: `/v1/project/test/export/${params.id}`,
  method: 'get',
  params: params,
  responseType: 'blob'
});

export default {
    getPage,
  BatchUpdateStatus,
    create,
    accept,
    bussStatus,
  getDataById,
    status,
    getComment,
    getHistory,
    getEdit,
    getExport
}
